/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * HomeHistory.java
 *
 * Created on Jun 16, 2009, 2:44:45 PM
 */

package viewer.mortgage;
import Household.Household;
import Bank.Bank;

/**
 *
 * @author karakots
 */
public class HomeHistory extends javax.swing.JFrame {

    public Household hh;
    public Bank bank;

    /** Creates new form HomeHistory */
    public HomeHistory() {
        initComponents();
        hh = null;
        bank = null;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        homeHistoryBorder = new javax.swing.JPanel();
        logText = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });

        homeHistoryBorder.setBorder(javax.swing.BorderFactory.createTitledBorder("History"));
        homeHistoryBorder.setOpaque(false);

        logLabel = logText;
        logText.setAutoscrolls(true);

        org.jdesktop.layout.GroupLayout homeHistoryBorderLayout = new org.jdesktop.layout.GroupLayout(homeHistoryBorder);
        homeHistoryBorder.setLayout(homeHistoryBorderLayout);
        homeHistoryBorderLayout.setHorizontalGroup(
            homeHistoryBorderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, logText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        homeHistoryBorderLayout.setVerticalGroup(
            homeHistoryBorderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(logText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE)
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, homeHistoryBorder, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, homeHistoryBorder, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
        // TODO add your handling code here:
        if (hh != null)
            hh.logViewOpen = false;
        else if (bank != null)
            bank.setLogViewOpen(false);
    }//GEN-LAST:event_formWindowClosed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new HomeHistory().setVisible(true);
            }
        });
    }

    public javax.swing.JLabel logLabel;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel homeHistoryBorder;
    private javax.swing.JLabel logText;
    // End of variables declaration//GEN-END:variables

}
